<?php

namespace app\admin\validate\Coupon;

use think\Validate;

class Cate extends Validate
{
    protected $rule = [
        'id'     => 'require',
        'name'   => 'require|max:25',
        'status' => 'require',
        'sort'   => 'require|number|egt:1'
    ];

    protected $message = [
        'id.require'     => '编号错误！',
        'name.require'   => '分类名称不能为空！',
        'status.require' => '状态不能为空！',
        'name.max'       => '分类名称不能超过25个字符',
        'sort.number'    => '排序必须是数字',
        'sort.egt'       => '排序必须大于等于1',
    ];

    protected $scene = [
        'edit_cate'  => ['name','status','sort'],
        'set_status' => ['id','status']
    ];
}
